fixed for-loop.
authorLars Hamann <lars@gtk.org>
Fri, 4 Dec 1998 00:04:31 +0000 (00:04 +0000)
committerLars Hamann <lars@src.gnome.org>
Fri, 4 Dec 1998 00:04:31 +0000 (00:04 +0000)
Fri Dec  4 00:50:12 1998  Lars Hamann  <lars@gtk.org>

* gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop.

* gtk/gtkclist.c
(gtk_clist_set_column_visibility)
(gtk_clist_column_titles_active)
  (gtk_clist_column_titles_active)
(gtk_clist_column_title_passive)
  (gtk_clist_column_title_active): few additional tests whether
  column->button != NULL

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkclist.c
gtk/gtkctree.c

index 8ced4127ad7c7c048f5ab441b4755907074a2cfd..c705531845af0d5c7243945d75ede165c587145a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Fri Dec  4 00:50:12 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop.
+
+       * gtk/gtkclist.c 
+       (gtk_clist_set_column_visibility)
+       (gtk_clist_column_titles_active)
+       (gtk_clist_column_titles_active)
+       (gtk_clist_column_title_passive)
+       (gtk_clist_column_title_active): few additional tests whether
+       column->button != NULL
+
 Thu Dec  3 16:49:18 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min
index 8ced4127ad7c7c048f5ab441b4755907074a2cfd..c705531845af0d5c7243945d75ede165c587145a 100644 (file)
@@ -1,3 +1,15 @@
+Fri Dec  4 00:50:12 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop.
+
+       * gtk/gtkclist.c 
+       (gtk_clist_set_column_visibility)
+       (gtk_clist_column_titles_active)
+       (gtk_clist_column_titles_active)
+       (gtk_clist_column_title_passive)
+       (gtk_clist_column_title_active): few additional tests whether
+       column->button != NULL
+
 Thu Dec  3 16:49:18 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min
index 8ced4127ad7c7c048f5ab441b4755907074a2cfd..c705531845af0d5c7243945d75ede165c587145a 100644 (file)
@@ -1,3 +1,15 @@
+Fri Dec  4 00:50:12 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop.
+
+       * gtk/gtkclist.c 
+       (gtk_clist_set_column_visibility)
+       (gtk_clist_column_titles_active)
+       (gtk_clist_column_titles_active)
+       (gtk_clist_column_title_passive)
+       (gtk_clist_column_title_active): few additional tests whether
+       column->button != NULL
+
 Thu Dec  3 16:49:18 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min
index 8ced4127ad7c7c048f5ab441b4755907074a2cfd..c705531845af0d5c7243945d75ede165c587145a 100644 (file)
@@ -1,3 +1,15 @@
+Fri Dec  4 00:50:12 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop.
+
+       * gtk/gtkclist.c 
+       (gtk_clist_set_column_visibility)
+       (gtk_clist_column_titles_active)
+       (gtk_clist_column_titles_active)
+       (gtk_clist_column_title_passive)
+       (gtk_clist_column_title_active): few additional tests whether
+       column->button != NULL
+
 Thu Dec  3 16:49:18 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min
index 8ced4127ad7c7c048f5ab441b4755907074a2cfd..c705531845af0d5c7243945d75ede165c587145a 100644 (file)
@@ -1,3 +1,15 @@
+Fri Dec  4 00:50:12 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop.
+
+       * gtk/gtkclist.c 
+       (gtk_clist_set_column_visibility)
+       (gtk_clist_column_titles_active)
+       (gtk_clist_column_titles_active)
+       (gtk_clist_column_title_passive)
+       (gtk_clist_column_title_active): few additional tests whether
+       column->button != NULL
+
 Thu Dec  3 16:49:18 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min
index 8ced4127ad7c7c048f5ab441b4755907074a2cfd..c705531845af0d5c7243945d75ede165c587145a 100644 (file)
@@ -1,3 +1,15 @@
+Fri Dec  4 00:50:12 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop.
+
+       * gtk/gtkclist.c 
+       (gtk_clist_set_column_visibility)
+       (gtk_clist_column_titles_active)
+       (gtk_clist_column_titles_active)
+       (gtk_clist_column_title_passive)
+       (gtk_clist_column_title_active): few additional tests whether
+       column->button != NULL
+
 Thu Dec  3 16:49:18 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min
index 8ced4127ad7c7c048f5ab441b4755907074a2cfd..c705531845af0d5c7243945d75ede165c587145a 100644 (file)
@@ -1,3 +1,15 @@
+Fri Dec  4 00:50:12 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkctree.c (gtk_ctree_export_to_gnode): fixed for-loop.
+
+       * gtk/gtkclist.c 
+       (gtk_clist_set_column_visibility)
+       (gtk_clist_column_titles_active)
+       (gtk_clist_column_titles_active)
+       (gtk_clist_column_title_passive)
+       (gtk_clist_column_title_active): few additional tests whether
+       column->button != NULL
+
 Thu Dec  3 16:49:18 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkdnd.c (DROP_ABORT_TIME): Changed to 5 min
index 08dabda04d35dab8e77fefce95264e46386b6c42..d49d4d3c5ee891285061ec4ad2eb1782b5856f52 100644 (file)
@@ -1255,7 +1255,7 @@ gtk_clist_column_titles_show (GtkCList *clist)
     {
       GTK_CLIST_SET_FLAG (clist, CLIST_SHOW_TITLES);
       if (clist->title_window)
-             gdk_window_show (clist->title_window);
+       gdk_window_show (clist->title_window);
       gtk_widget_queue_resize (GTK_WIDGET (clist));
     }
 }
@@ -1270,7 +1270,7 @@ gtk_clist_column_titles_hide (GtkCList *clist)
     {
       GTK_CLIST_UNSET_FLAG (clist, CLIST_SHOW_TITLES);
       if (clist->title_window)
-             gdk_window_hide (clist->title_window);
+       gdk_window_hide (clist->title_window);
       gtk_widget_queue_resize (GTK_WIDGET (clist));
     }
 }
@@ -1284,6 +1284,8 @@ gtk_clist_column_title_active (GtkCList *clist,
 
   if (column < 0 || column >= clist->columns)
     return;
+  if (!clist->column[column].button)
+    return;
 
   if (!GTK_WIDGET_SENSITIVE (clist->column[column].button) ||
       !GTK_WIDGET_CAN_FOCUS (clist->column[column].button))
@@ -1304,6 +1306,8 @@ gtk_clist_column_title_passive (GtkCList *clist,
 
   if (column < 0 || column >= clist->columns)
     return;
+  if (!clist->column[column].button)
+    return;
 
   if (GTK_WIDGET_SENSITIVE (clist->column[column].button) ||
       GTK_WIDGET_CAN_FOCUS (clist->column[column].button))
@@ -1324,8 +1328,7 @@ gtk_clist_column_titles_active (GtkCList *clist)
   g_return_if_fail (GTK_IS_CLIST (clist));
 
   for (i = 0; i < clist->columns; i++)
-    if (clist->column[i].button)
-      gtk_clist_column_title_active (clist, i);
+    gtk_clist_column_title_active (clist, i);
 }
 
 void
@@ -1336,9 +1339,11 @@ gtk_clist_column_titles_passive (GtkCList *clist)
   g_return_if_fail (clist != NULL);
   g_return_if_fail (GTK_IS_CLIST (clist));
 
+  if (!GTK_CLIST_SHOW_TITLES (clist))
+    return;
+
   for (i = 0; i < clist->columns; i++)
-    if (clist->column[i].button)
-      gtk_clist_column_title_passive (clist, i);
+    gtk_clist_column_title_passive (clist, i);
 }
 
 void
@@ -1554,10 +1559,14 @@ gtk_clist_set_column_visibility (GtkCList *clist,
     }
 
   clist->column[column].visible = visible;
-  if (visible)
-    gtk_widget_show (clist->column[column].button);
-  else
-    gtk_widget_hide (clist->column[column].button);
+
+  if (clist->column[column].button)
+    {
+      if (visible)
+       gtk_widget_show (clist->column[column].button);
+      else
+       gtk_widget_hide (clist->column[column].button);
+    }
 }
 
 void
index 132e3a44b69884f54abe0a309d7c5d7023755890..e4940fd32c95dac8bd9518149459a4d987db7c05 100644 (file)
@@ -4157,7 +4157,6 @@ gtk_ctree_export_to_gnode (GtkCTree          *ctree,
 {
   GtkCTreeNode *work;
   GNode *gnode;
-  GNode *new_sibling;
   gint depth;
 
   g_return_val_if_fail (ctree != NULL, NULL);
@@ -4182,15 +4181,17 @@ gtk_ctree_export_to_gnode (GtkCTree          *ctree,
   if (parent)
     g_node_insert_before (parent, sibling, gnode);
 
-  for (work = GTK_CTREE_ROW (node)->children, new_sibling = NULL; work;
-       work = GTK_CTREE_NODE_NEXT (work))
+  if (!GTK_CTREE_ROW (node)->is_leaf)
     {
-      sibling = gtk_ctree_export_to_gnode (ctree, gnode, new_sibling,
-                                          work, func, data);
-      if (sibling)
-       new_sibling = sibling;
+      GNode *new_sibling = NULL;
+
+      for (work = GTK_CTREE_ROW (node)->children; work;
+          work = GTK_CTREE_ROW (work)->sibling)
+       new_sibling = gtk_ctree_export_to_gnode (ctree, gnode, new_sibling,
+                                                work, func, data);
+
+      g_node_reverse_children (gnode);
     }
-  g_node_reverse_children (gnode);
 
   return gnode;
 }